package cn.edu.ecnu.gis;
public class CalculatorTestCase extends TestCase {
    private SCADomain scaDomain;
    private CalculatorService calculatorService;
    @Override
    protected void setUp() throws Exception {
        scaDomain = SCADomain.newInstance("Calculator.composite");
        calculatorService = scaDo-main.getService(CalculatorService.class, "CalculatorServiceCompo-nent");
    }
    @Override
    protected void tearDown() throws Exception {
        scaDomain.close();
    }
    public void testCalculator() throws Exception {
        // Calculate
        assertEquals(calculatorService.add(3, 2), 5.0);
        assertEquals(calculatorService.subtract(3, 2), 1.0);
        assertEquals(calculatorService.multiply(3, 2), 6.0);
        assertEquals(calculatorService.divide(3, 2), 1.5);
    }
}
